package com.platform.provider.function;

import com.platform.common.bean.User;
import com.platform.common.interfaces.IDemoFunction;
import com.platform.provider.service.QueryUserInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;


@Slf4j
@RestController
public class DemoFunction implements IDemoFunction {
    @Autowired
    private QueryUserInfoService queryUserInfoService;

    @Override
    @RequestMapping("/demoFunction")
    public String demoFunction(String name){
        log.info("into DemoFunction...");
        Date date = new Date();
        return "Hello,"+name+",Today is "+date.toString();
    }

    @RequestMapping("/userDemo")
    public User userDemo(Integer userId){
        return queryUserInfoService.queryUserInfo(userId);
    }
}
